package main

import (
	"runtime"
	"fmt"
)

func main() {

	//logfile, _ := os.Create("./log.txt")
	//defer logfile.Close()
	//logger := log.New(logfile, "example ", log.LstdFlags|log.Lshortfile)
	//logger.Println("This is a regular message.")
	//logger.Fatalln("This is a fatal error.")
	//logger.Println("This is the end of the function.")

	//conn, err := net.Dial("tcp", "localhost:1902")
	//if err != nil {
	//	panic("Failed to connect to localhost:1902")
	//}
	//defer conn.Close()
	//f := log.Ldate | log.Lshortfile
	//logger := log.New(conn, "example ", f)
	//logger.Println("This is a regular message.")
	//logger.Panicln("This is a panic.")

	foo()


}

func foo() {
	bar()
}
func bar() {
	buf := make([]byte, 1024)
	runtime.Stack(buf, false)
	fmt.Printf("Trace:\n %s\n", buf)
}
